package middleware

import (
	"github.com/gin-gonic/gin"
	"smart-sensor-cloud/internal/api"
)

var apiClient *api.Client

func InitAPIClient(host, token string) {
	apiClient = api.NewClient(host, token)
}

func APIClientMiddleware(c *gin.Context) {
	c.Set("api", apiClient)
	c.Next()
}
